import request from "@/utils/request.js"

/**
 * 分页查询操作日志
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const queryOperateLogPage = (data) => {
  return request.post("/admin/oplog/page", data)
}

/**
 * 根据id查询操作日志
 * @param id
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const getOperateLogById = (id) => {
  return request.get("/admin/oplog/" + id)
}

/**
 * 删除操作日志
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const removeOperateLog = (data) => {
  return request.delete("/admin/oplog", {data})
}

/**
 * 导出操作日志
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const exportOperateLog = (data) => {
  return request.post("/admin/oplog/export", data, {
    responseType: "blob"
  })
}
